/**
 * a dummy person class
 * @author Lukas Koell
 * @author David Medenjak
 * @author Johannes Riedmann
 */

public class Person implements Comparable<Person>{

    /** name of the Person */
    private String name;

    /**
     * Constructor.
     * @param name Name of the person.
     */
    public Person (String name) {
        this.name = name;
    }
    
    /**
     * @return name of the person
     */
    public String getName() {
        return name;
    }
    
    /**
     * sets the person's name
     * @param name Name of person.
     */
    public void setName(String name) {
        this.name = name;
    }
    
    /**
     * @return String representation for Person
     */
    public String toString() {
        return name;
    }

    /**
     * @param p Person to compare with.
     * @return 0 if the names of Person objects are equal (ignoring case)
     */
    @Override
    public int compareTo(Person p) {
        return name.compareToIgnoreCase(p.name);
    }
}